<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>直播专题内容</title>
	<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport" />
	<meta content="yes" name="apple-mobile-web-app-capable" />
	<meta content="black" name="apple-mobile-web-app-status-bar-style" />
	<meta content="telephone=no" name="format-detection" />
	<link href="../Ryancss/tv_special.css" rel="stylesheet" type="text/css" />
</head>
<body>

<section class="aui-flexView" style="height:auto" > <!--已启用图片L加载-->

	<section class="aui-scrollView">
		<div class="aui-head-bg">
			<img src="">
		</div>
		<div class="aui-commodity"  id="TvListJh_list">
		
		
		
		
						
	
								        	<script type="text/x-dot-template" id="TvListJh_template">
												{{~ it.msg : value : index }}
								
																							
													<a onclick="openVideoWin('{{= value. url }}','{{= value. title }}','special')" class="aui-flex">
														<div class="aui-comm-img">
															<img   src="{{= value. img }}"  >	
													</div>
														<div class="aui-flex-box">
															<h1><em>直播</em>{{= value. content }}</h1>
															<span>{{= value. title }}</span>

														</div>
													</a>
													
													
												{{~}}
											</script>



		
	
			<a  class="aui-flex">
				<div class="aui-comm-img">

					<img  src="">
				</div>
				<div class="aui-flex-box">
					<h1><em>  Loading…</em>加载中</h1>
					<span> - - - </span>

				</div>
			</a>

		</div>
	</section>
</section>
</body>
	<script type="text/javascript" src="../script/api.js"></script>
	<script type="text/javascript" src="../script/doT.js"></script>
<script type="text/javascript">
  var api_url = localStorage.getItem('api_url');
  var i = 1;
		/////  初始化执行   S /////
		/////  apiready  一打开就执行的 函数

		apiready = function() {


			getTvListJh(); //获取电视直播列表 集合
									// 网络状态
		api.addEventListener({
			name:'offline'
		}, function(ret, err){        

			api.toast({
			msg : '网络连接异常',
			duration : 5000,
			location : 'middle' 
			});

			  

		});

		api.addEventListener({
			name:'online'
		}, function(ret, err){        
		
			  api.toast({
			  msg : '已经连接网络',
			  duration : 2000,
			  location : 'middle' 
			  });
				  
getTvListJh(); //获取电视直播列表 集合

				  
		});	

		}
		/////  初始化执行   E /////
		
		
	//图片延迟加载	
	function echoInit() {
        echo.init({
                offset : 0,
                throttle : 0 //设置图片延迟加载的时间
        });
}




//////////////////////   获取电视TV直播列表  方法   getList    S ////////// 集合//////////// 
  function getTvListJh(){

/*
		 api.showProgress({
			  title: '加载中',
			  modal: false
		 });
	*/
	
	
    var TvListJh_list = $api.byId('TvListJh_list');
    var TvListJh_template = $api.byId('TvListJh_template');
    api.ajax({
       	url: api_url+'/login/login/tvlist_jh.html',
        method: 'get',              
				data: {
                  values: {
			key: 'p2piunink',   //安全码
                  }
              }
    },function(ret, err){
        if (ret) {
          //alert( JSON.stringify( ret ) );
          var pagefn = doT.template(TvListJh_template.text);
          TvListJh_list.innerHTML = pagefn(ret);
		  
          api.hideProgress();
        } else {
          api.hideProgress();
            //alert( JSON.stringify( err ) );
        }
		
		
		
    });
	

  }

//////////////////////   获取电视TV直播列表  方法   getList    E //////////////////////




//////////////////////   打开电视直播列表  方法     S ////////////////////// 


		function openVideoWin(url,name,source) {


                                                                                             var delay = 0;
                                                                                             if(api.systemType != 'ios'){
                                                                                                 delay = 300;
                                                                                             }
                                                                                             api.openWin({
                                                                                                 name: 'video_play_win',
                                                                                                 url: 'video_play_win.html',
                                                                                                 bounces:false,
                                                                                                 delay: delay,
                                                                                                 slidBackEnabled:true,
                                                                                                 vScrollBarEnabled:false,
																								pageParam:{video:url,title:name}
                                                                                             });
																							 
																							 
																							 
	 /*											                                             api.toast({
                                                                                                 msg: source
                                                                                             });											 
																							 
    api.addEventListener({
         name:'viewdisappear'
     },function(){
         api.closeWin({
              name:api.winName
         });
     });
*/

    }


//////////////////////   打开电视直播列表  方法     E //////////////////////







  function closeWin(){
      api.closeWin({
      });
  }
  





</script>
	
</html>
